<?php
class View_Message_Send extends View_Message
{
	/**
	 *	...
	 *	@access		public
	 *	@return		string
	 */
	public function buildContent()
	{
		$words		= $this->words['message']['send'];
		$current	= $this->auth->getCurrentUser();

		$users		= Logic_User::getUsers( array(), array( 'username' => 'ASC' ) );
		$opt_receivers	= array();
		foreach( $users as $user )
			if( $user['userId'] != $current )
				$opt_receivers[$user['userId']] = $user['username'];
		if( $this->request->get( 'receivers' ) )
			$opt_receivers['_selected']	= $this->request->get( 'receivers' );

		//  --  COMPONENTS  --  //
		$ui	= array(
			'words'			=> $words,
			'form'			=> $this->buildForm(
				'message',
				'sendMessage',
				'message',
				'send',
				array(),
				array(
					'opt_receivers' => $opt_receivers
				)
			)
			,
			'buttonCancel'	=> $this->html->LinkButton(
				self::getUrl(),
				$words['buttonCancel'],
				'but cancel'
			),
			'buttonSend'	=> $this->html->Button(
				'sendMessage',
				$words['buttonSend'],
				'but edit'
			),
			'form.tag'		=> $this->html->Form( 'sendMessage', self::getUrl( array( 'action' => 'add' ) ) ),
			'colgroup'		=> $this->html->ColumnGroup( "25%", "75%" ),
			'caption'		=> $this->html->TableCaption( $words['caption'], 'edit' ),
		);
		return $this->loadTemplate( 'message.send', $ui );
	}
}
?>